/**
 ******************************************************************************
 * @file           : parameter.c
 * @brief          : 参数系统相关,基于存储底层架构实现的参数存储、索引等
 ******************************************************************************
 * @attention
 *
 ******************************************************************************
 */

/* includes ------------------------------------------------------------------*/
#include "bsp.h"
#include "parameter.h"

static char inputbuffer[INPUTBUF_MAXLEN];
static volatile uint8_t intput_pos = 0;

static const Sto_MaintainStru sto_maintain[] =
{
  /* 本机编号 */
  {
    .idx = sto_mtidx(local_number),
    .page = 0,
    .focus = 0,
    .addr = sto_addr(local_number),
    .fixstr = &sto_fixstr_pointer(local_number),
    .dynstr = sto_dynstr_fpointer(local_number),
    .ckcb = sto_ckcb_general_ut32,
    .upcb = sto_upcb_fpointer(local_number),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.ut32 = 0,
    .max.ut32  = 0xffffffffu,
    .min.ut32  = 0,
  },
  /* 量程 t/h */
  {
    .idx = sto_mtidx(measuring_range_tph),
    .page = 0,
    .focus = 1,
    .addr = sto_addr(measuring_range_tph),
    .fixstr = &sto_fixstr_pointer(measuring_range_tph),
    .dynstr = sto_dynstr_fpointer(measuring_range_tph),
    .ckcb = sto_ckcb_general_ut32,
    .upcb = sto_upcb_fpointer(measuring_range_tph),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.ut32 = 10000,
    .max.ut32  = 9999999,
    .min.ut32  = 1000,
  },
  /* 仅参数显示-时间 */
  {
    .idx = 0xffu,
    .page = 0,
    .focus = 2,
    .addr = 0,
    .fixstr = &sto_fixstr_pointer(para_display_time),
    .dynstr = sto_dynstr_fpointer(para_display_time),
    .ckcb = NULL,
    .upcb = NULL,
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.ut32 = 0,
    .max.ut32  = 235959,
    .min.ut32  = 0,
  },
  /* 仅参数显示-日期 */
  {
    .idx = 0xffu,
    .page = 0,
    .focus = 3,
    .addr = 0,
    .fixstr = &sto_fixstr_pointer(para_display_date),
    .dynstr = sto_dynstr_fpointer(para_display_date),
    .ckcb = NULL,
    .upcb = NULL,
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.ut32 = 0,
    .max.ut32  = 991231,
    .min.ut32  = 0,
  },
  /* 累计分度值 kg enum */
  {
    .idx = sto_mtidx(division_kg),
    .page = 1,
    .focus = 0,
    .addr = sto_addr(division_kg),
    .fixstr = &sto_fixstr_pointer(division_kg),
    .dynstr = sto_dynstr_fpointer(division_kg),
    .ckcb = sto_ckcb_general_ut16,
    .upcb = sto_upcb_fpointer(division_kg),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.ut16 = 0,
    .max.ut16  = 9,
    .min.ut16  = 0,
  },
  /* 自动调零强度 */
  {
    .idx = sto_mtidx(auto_zero_range),
    .page = 1,
    .focus = 1,
    .addr = sto_addr(auto_zero_range),
    .fixstr = &sto_fixstr_pointer(auto_zero_range),
    .dynstr = sto_dynstr_fpointer(auto_zero_range),
    .ckcb = sto_ckcb_general_ut16,
    .upcb = sto_upcb_fpointer(auto_zero_range),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.ut16 = 0,
    .max.ut16  = 0xffff,
    .min.ut16  = 0,
  },
  /* 重量内码内给开关 */
  {
    .idx = sto_mtidx(wad_preset_enable),
    .page = 1,
    .focus = 2,
    .addr = sto_addr(wad_preset_enable),
    .fixstr = &sto_fixstr_pointer(wad_preset_enable),
    .dynstr = sto_dynstr_fpointer(wad_preset_enable),
    .ckcb = sto_ckcb_general_bool,
    .upcb = sto_upcb_fpointer(wad_preset_enable),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.ut16 = 0,
    .max.ut16 = 1,
    .min.ut16 = 0,
  },
  /* 重量内码内给值 */
  {
    .idx = sto_mtidx(wad_preset_value),
    .page = 1,
    .focus = 3,
    .addr = sto_addr(wad_preset_value),
    .fixstr = &sto_fixstr_pointer(wad_preset_value),
    .dynstr = sto_dynstr_fpointer(wad_preset_value),
    .ckcb = sto_ckcb_general_st32,
    .upcb = sto_upcb_fpointer(wad_preset_value),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.st32 = 0,
    .max.st32 = 65535,
    .min.st32 = -65535,
  },
  /* 速度内码内给开关 */
  {
    .idx = sto_mtidx(sad_preset_enable),
    .page = 1,
    .focus = 4,
    .addr = sto_addr(sad_preset_enable),
    .fixstr = &sto_fixstr_pointer(sad_preset_enable),
    .dynstr = sto_dynstr_fpointer(sad_preset_enable),
    .ckcb = sto_ckcb_general_bool,
    .upcb = sto_upcb_fpointer(sad_preset_enable),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.ut16 = 0,
    .max.ut16 = 1,
    .min.ut16 = 0,
  },
  /* 速度内码内给值 */
  {
    .idx = sto_mtidx(sad_preset_value),
    .page = 1,
    .focus = 5,
    .addr = sto_addr(sad_preset_value),
    .fixstr = &sto_fixstr_pointer(sad_preset_value),
    .dynstr = sto_dynstr_fpointer(sad_preset_value),
    .ckcb = sto_ckcb_general_ut16,
    .upcb = sto_upcb_fpointer(sad_preset_value),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.ut16 = 0,
    .max.ut16 = 65535,
    .min.ut16 = 0,
  },
  /* 有效流量下限 t/h */
  {
    .idx = sto_mtidx(flowrate_lowlim_kgh),
    .page = 1,
    .focus = 6,
    .addr = sto_addr(flowrate_lowlim_kgh),
    .fixstr = &sto_fixstr_pointer(flowrate_lowlim_kgh),
    .dynstr = sto_dynstr_fpointer(flowrate_lowlim_kgh),
    .ckcb = sto_ckcb_general_st16,
    .upcb = sto_upcb_fpointer(flowrate_lowlim_kgh),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.st16 = 5,
    .max.st16 = 32767,
    .min.st16 = -32768,
  },
  /* 实测速度内码下限 ????? */
  {
    .idx = sto_mtidx(speed_low_limit),
    .page = 1,
    .focus = 7,
    .addr = sto_addr(speed_low_limit),
    .fixstr = &sto_fixstr_pointer(speed_low_limit),
    .dynstr = sto_dynstr_fpointer(speed_low_limit),
    .ckcb = sto_ckcb_general_ut16,
    .upcb = sto_upcb_fpointer(speed_low_limit),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.ut16 = 100,
    .max.ut16 = 0xffff,
    .min.ut16 = 0,
  },
  /* 当日班数 */
  {
    .idx = sto_mtidx(num_of_class),
    .page = 2,
    .focus = 0,
    .addr = sto_addr(num_of_class),
    .fixstr = &sto_fixstr_pointer(num_of_class),
    .dynstr = sto_dynstr_fpointer(num_of_class),
    .ckcb = sto_ckcb_general_ut16,
    .upcb = sto_upcb_fpointer(num_of_class),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.ut16 = 3,
    .max.ut16  = 3,
    .min.ut16  = 0,
  },
  /* 日累计起始点 */
  {
    .idx = sto_mtidx(day_begin_zero),
    .page = 2,
    .focus = 1,
    .addr = sto_addr(day_begin_zero),
    .fixstr = &sto_fixstr_pointer(day_begin_zero),
    .dynstr = sto_dynstr_fpointer(day_begin_zero),
    .ckcb = sto_ckcb_general_bool,
    .upcb = sto_upcb_fpointer(day_begin_zero),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.ut16 = 0,
    .max.ut16  = 1,
    .min.ut16  = 0,
  },
  /* 月累计起始点 */
  {
    .idx = sto_mtidx(month_begin_zero),
    .page = 2,
    .focus = 2,
    .addr = sto_addr(month_begin_zero),
    .fixstr = &sto_fixstr_pointer(month_begin_zero),
    .dynstr = sto_dynstr_fpointer(month_begin_zero),
    .ckcb = sto_ckcb_general_bool,
    .upcb = sto_upcb_fpointer(month_begin_zero),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.ut16 = 0,
    .max.ut16  = 1,
    .min.ut16  = 0,
  },
  /* 年累计起始点 */
  {
    .idx = sto_mtidx(year_begin_zero),
    .page = 2,
    .focus = 3,
    .addr = sto_addr(year_begin_zero),
    .fixstr = &sto_fixstr_pointer(year_begin_zero),
    .dynstr = sto_dynstr_fpointer(year_begin_zero),
    .ckcb = sto_ckcb_general_bool,
    .upcb = sto_upcb_fpointer(year_begin_zero),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.ut16 = 0,
    .max.ut16  = 1,
    .min.ut16  = 0,
  },
  /* 班01累计起始 */
  {
    .idx = sto_mtidx(acc_class01_start_time),
    .page = 2,
    .focus = 4,
    .addr = sto_addr(acc_class01_start_time),
    .fixstr = &sto_fixstr_pointer(acc_class01_start_time),
    .dynstr = sto_dynstr_fpointer(acc_class01_start_time),
    .ckcb = sto_ckcb_general_ut32,
    .upcb = sto_upcb_fpointer(acc_class01_start_time),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.ut32 = 0,
    .max.ut32  = 86400,
    .min.ut32  = 0,
  },
  /* 班02累计起始 */
  {
    .idx = sto_mtidx(acc_class02_start_time),
    .page = 2,
    .focus = 5,
    .addr = sto_addr(acc_class02_start_time),
    .fixstr = &sto_fixstr_pointer(acc_class02_start_time),
    .dynstr = sto_dynstr_fpointer(acc_class02_start_time),
    .ckcb = sto_ckcb_general_ut32,
    .upcb = sto_upcb_fpointer(acc_class02_start_time),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.ut32 = 0,
    .max.ut32  = 86400,
    .min.ut32  = 0,
  },
  /* 班03累计起始 */
  {
    .idx = sto_mtidx(acc_class03_start_time),
    .page = 2,
    .focus = 6,
    .addr = sto_addr(acc_class03_start_time),
    .fixstr = &sto_fixstr_pointer(acc_class03_start_time),
    .dynstr = sto_dynstr_fpointer(acc_class03_start_time),
    .ckcb = sto_ckcb_general_ut32,
    .upcb = sto_upcb_fpointer(acc_class03_start_time),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.ut32 = 0,
    .max.ut32  = 86400,
    .min.ut32  = 0,
  },
  /* 班04累计起始 */
  {
    .idx = sto_mtidx(acc_class04_start_time),
    .page = 2,
    .focus = 7,
    .addr = sto_addr(acc_class04_start_time),
    .fixstr = &sto_fixstr_pointer(acc_class04_start_time),
    .dynstr = sto_dynstr_fpointer(acc_class04_start_time),
    .ckcb = sto_ckcb_general_ut32,
    .upcb = sto_upcb_fpointer(acc_class04_start_time),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.ut32 = 0,
    .max.ut32  = 86400,
    .min.ut32  = 0,
  },
  /* 班01累计 */
  {
    .idx = sto_mtidx(class01_acc_0d1g),
    .page = 2,
    .focus = 8,
    .addr = sto_addr(class01_acc_0d1g),
    .fixstr = &sto_fixstr_pointer(class01_acc_0d1g),
    .dynstr = sto_dynstr_fpointer(class01_acc_0d1g),
    .ckcb = NULL,
    .upcb = sto_upcb_fpointer(class01_acc_0d1g),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.db64 = 0,
    .max.db64  = 0,
    .min.db64  = 0,
  },
  /* 班02累计 */
  {
    .idx = sto_mtidx(class02_acc_0d1g),
    .page = 2,
    .focus = 9,
    .addr = sto_addr(class02_acc_0d1g),
    .fixstr = &sto_fixstr_pointer(class02_acc_0d1g),
    .dynstr = sto_dynstr_fpointer(class02_acc_0d1g),
    .ckcb = NULL,
    .upcb = sto_upcb_fpointer(class02_acc_0d1g),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.db64 = 0,
    .max.db64  = 0,
    .min.db64  = 0,
  },
  /* 班03累计 */
  {
    .idx = sto_mtidx(class03_acc_0d1g),
    .page = 2,
    .focus = 10,
    .addr = sto_addr(class03_acc_0d1g),
    .fixstr = &sto_fixstr_pointer(class03_acc_0d1g),
    .dynstr = sto_dynstr_fpointer(class03_acc_0d1g),
    .ckcb = NULL,
    .upcb = sto_upcb_fpointer(class03_acc_0d1g),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.db64 = 0,
    .max.db64  = 0,
    .min.db64  = 0,
  },
  /* 班04累计 */
  {
    .idx = sto_mtidx(class04_acc_0d1g),
    .page = 2,
    .focus = 11,
    .addr = sto_addr(class04_acc_0d1g),
    .fixstr = &sto_fixstr_pointer(class04_acc_0d1g),
    .dynstr = sto_dynstr_fpointer(class04_acc_0d1g),
    .ckcb = NULL,
    .upcb = sto_upcb_fpointer(class04_acc_0d1g),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.db64 = 0,
    .max.db64  = 0,
    .min.db64  = 0,
  },
  /* 时累计 */
  {
    .idx = sto_mtidx(hour_acc_0d1g),
    .page = 2,
    .focus = 12,
    .addr = sto_addr(hour_acc_0d1g),
    .fixstr = &sto_fixstr_pointer(hour_acc_0d1g),
    .dynstr = sto_dynstr_fpointer(hour_acc_0d1g),
    .ckcb = NULL,
    .upcb = sto_upcb_fpointer(hour_acc_0d1g),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.db64 = 0,
    .max.db64  = 0,
    .min.db64  = 0,
  },
  /* 日累计 */
  {
    .idx = sto_mtidx(day_acc_0d1g),
    .page = 2,
    .focus = 13,
    .addr = sto_addr(day_acc_0d1g),
    .fixstr = &sto_fixstr_pointer(day_acc_0d1g),
    .dynstr = sto_dynstr_fpointer(day_acc_0d1g),
    .ckcb = NULL,
    .upcb = sto_upcb_fpointer(day_acc_0d1g),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.db64 = 0,
    .max.db64  = 0,
    .min.db64  = 0,
  },
  /* 月累计 */
  {
    .idx = sto_mtidx(month_acc_0d1g),
    .page = 2,
    .focus = 14,
    .addr = sto_addr(month_acc_0d1g),
    .fixstr = &sto_fixstr_pointer(month_acc_0d1g),
    .dynstr = sto_dynstr_fpointer(month_acc_0d1g),
    .ckcb = NULL,
    .upcb = sto_upcb_fpointer(month_acc_0d1g),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.db64 = 0,
    .max.db64  = 0,
    .min.db64  = 0,
  },
  /* 年累计 */
  {
    .idx = sto_mtidx(year_acc_0d1g),
    .page = 2,
    .focus = 15,
    .addr = sto_addr(year_acc_0d1g),
    .fixstr = &sto_fixstr_pointer(year_acc_0d1g),
    .dynstr = sto_dynstr_fpointer(year_acc_0d1g),
    .ckcb = NULL,
    .upcb = sto_upcb_fpointer(year_acc_0d1g),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.db64 = 0,
    .max.db64  = 0,
    .min.db64  = 0,
  },
  /* 总累计 */
  {
    .idx = sto_mtidx(total_acc_0d1g),
    .page = 2,
    .focus = 16,
    .addr = sto_addr(total_acc_0d1g),
    .fixstr = &sto_fixstr_pointer(total_acc_0d1g),
    .dynstr = sto_dynstr_fpointer(total_acc_0d1g),
    .ckcb = NULL,
    .upcb = sto_upcb_fpointer(total_acc_0d1g),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.db64 = 0,
    .max.db64  = 0,
    .min.db64  = 0,
  },
  /* 班01累计_上次 */
  {
    .idx = sto_mtidx(class01_acc_last_0d1g),
    .page = 2,
    .focus = 17,
    .addr = sto_addr(class01_acc_last_0d1g),
    .fixstr = &sto_fixstr_pointer(class01_acc_last_0d1g),
    .dynstr = sto_dynstr_fpointer(class01_acc_last_0d1g),
    .ckcb = NULL,
    .upcb = sto_upcb_fpointer(class01_acc_last_0d1g),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.db64 = 0,
    .max.db64  = 0,
    .min.db64  = 0,
  },
  /* 班02累计_上次 */
  {
    .idx = sto_mtidx(class02_acc_last_0d1g),
    .page = 2,
    .focus = 18,
    .addr = sto_addr(class02_acc_last_0d1g),
    .fixstr = &sto_fixstr_pointer(class02_acc_last_0d1g),
    .dynstr = sto_dynstr_fpointer(class02_acc_last_0d1g),
    .ckcb = NULL,
    .upcb = sto_upcb_fpointer(class02_acc_last_0d1g),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.db64 = 0,
    .max.db64  = 0,
    .min.db64  = 0,
  },
  /* 班03累计_上次 */
  {
    .idx = sto_mtidx(class03_acc_last_0d1g),
    .page = 2,
    .focus = 19,
    .addr = sto_addr(class03_acc_last_0d1g),
    .fixstr = &sto_fixstr_pointer(class03_acc_last_0d1g),
    .dynstr = sto_dynstr_fpointer(class03_acc_last_0d1g),
    .ckcb = NULL,
    .upcb = sto_upcb_fpointer(class03_acc_last_0d1g),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.db64 = 0,
    .max.db64  = 0,
    .min.db64  = 0,
  },
  /* 班04累计_上次 */
  {
    .idx = sto_mtidx(class04_acc_last_0d1g),
    .page = 2,
    .focus = 20,
    .addr = sto_addr(class04_acc_last_0d1g),
    .fixstr = &sto_fixstr_pointer(class04_acc_last_0d1g),
    .dynstr = sto_dynstr_fpointer(class04_acc_last_0d1g),
    .ckcb = NULL,
    .upcb = sto_upcb_fpointer(class04_acc_last_0d1g),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.db64 = 0,
    .max.db64  = 0,
    .min.db64  = 0,
  },
  /* 时累计_上次 */
  {
    .idx = sto_mtidx(hour_acc_last_0d1g),
    .page = 2,
    .focus = 21,
    .addr = sto_addr(hour_acc_last_0d1g),
    .fixstr = &sto_fixstr_pointer(hour_acc_last_0d1g),
    .dynstr = sto_dynstr_fpointer(hour_acc_last_0d1g),
    .ckcb = NULL,
    .upcb = sto_upcb_fpointer(hour_acc_last_0d1g),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.db64 = 0,
    .max.db64  = 0,
    .min.db64  = 0,
  },
  /* 日累计_上次 */
  {
    .idx = sto_mtidx(day_acc_last_0d1g),
    .page = 2,
    .focus = 22,
    .addr = sto_addr(day_acc_last_0d1g),
    .fixstr = &sto_fixstr_pointer(day_acc_last_0d1g),
    .dynstr = sto_dynstr_fpointer(day_acc_last_0d1g),
    .ckcb = NULL,
    .upcb = sto_upcb_fpointer(day_acc_last_0d1g),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.db64 = 0,
    .max.db64  = 0,
    .min.db64  = 0,
  },
  /* 月累计_上次 */
  {
    .idx = sto_mtidx(month_acc_last_0d1g),
    .page = 2,
    .focus = 23,
    .addr = sto_addr(month_acc_last_0d1g),
    .fixstr = &sto_fixstr_pointer(month_acc_last_0d1g),
    .dynstr = sto_dynstr_fpointer(month_acc_last_0d1g),
    .ckcb = NULL,
    .upcb = sto_upcb_fpointer(month_acc_last_0d1g),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.db64 = 0,
    .max.db64  = 0,
    .min.db64  = 0,
  },
  /* 年累计_上次 */
  {
    .idx = sto_mtidx(year_acc_last_0d1g),
    .page = 2,
    .focus = 24,
    .addr = sto_addr(year_acc_last_0d1g),
    .fixstr = &sto_fixstr_pointer(year_acc_last_0d1g),
    .dynstr = sto_dynstr_fpointer(year_acc_last_0d1g),
    .ckcb = NULL,
    .upcb = sto_upcb_fpointer(year_acc_last_0d1g),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.db64 = 0,
    .max.db64  = 0,
    .min.db64  = 0,
  },
  /* 总累计_上次 */
  {
    .idx = sto_mtidx(total_acc_last_0d1g),
    .page = 2,
    .focus = 25,
    .addr = sto_addr(total_acc_last_0d1g),
    .fixstr = &sto_fixstr_pointer(total_acc_last_0d1g),
    .dynstr = sto_dynstr_fpointer(total_acc_last_0d1g),
    .ckcb = NULL,
    .upcb = sto_upcb_fpointer(total_acc_last_0d1g),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.db64 = 0,
    .max.db64  = 0,
    .min.db64  = 0,
  },
  /* 累计全部清零 仅显示 不存储 */
  {
    .idx = 0xffu,
    .page = 2,
    .focus = 26,
    .addr = 0,
    .fixstr = &sto_fixstr_pointer(acc_all_clear),
    .dynstr = sto_dynstr_fpointer(acc_all_clear),
    .ckcb = NULL,
    .upcb = NULL,
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.ut8 = 0,
    .max.ut8  = 0,
    .min.ut8  = 0,
  },

  /* 首页位置1显示 0班累计 1日累计 2月累计 3年累计 4时累计 5间隔产量 */
  {
    .idx = sto_mtidx(main_display_pos1),
    .page = 3,
    .focus = 0,
    .addr = sto_addr(main_display_pos1),
    .fixstr = &sto_fixstr_pointer(main_display_pos1),
    .dynstr = sto_dynstr_fpointer(main_display_pos1),
    .ckcb = sto_ckcb_general_ut16,
    .upcb = sto_upcb_fpointer(main_display_pos1),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.ut16 = 1,
    .max.ut16  = 5,
    .min.ut16  = 0,
  },
  /* 首页位置2显示 0流量 1载荷 2速度 */
  {
    .idx = sto_mtidx(main_display_pos2),
    .page = 3,
    .focus = 1,
    .addr = sto_addr(main_display_pos2),
    .fixstr = &sto_fixstr_pointer(main_display_pos2),
    .dynstr = sto_dynstr_fpointer(main_display_pos2),
    .ckcb = sto_ckcb_general_ut16,
    .upcb = sto_upcb_fpointer(main_display_pos2),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.ut16 = 0,
    .max.ut16  = 2,
    .min.ut16  = 0,
  },
  /* 显示刷新率 1~20 */
  {
    .idx = sto_mtidx(refresh_rate),
    .page = 3,
    .focus = 2,
    .addr = sto_addr(refresh_rate),
    .fixstr = &sto_fixstr_pointer(refresh_rate),
    .dynstr = sto_dynstr_fpointer(refresh_rate),
    .ckcb = sto_ckcb_general_ut16,
    .upcb = sto_upcb_fpointer(refresh_rate),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.ut16 = 10,
    .max.ut16  = 20,
    .min.ut16  = 1,
  },
  
  /* 定量重量设定 kg ##### */
  {
    .idx = sto_mtidx(weight_pulse_set_kg),
    .page = 4,
    .focus = 0,
    .addr = sto_addr(weight_pulse_set_kg),
    .fixstr = &sto_fixstr_pointer(weight_pulse_set_kg),
    .dynstr = sto_dynstr_fpointer(weight_pulse_set_kg),
    .ckcb = sto_ckcb_general_ut32,
    .upcb = sto_upcb_fpointer(weight_pulse_set_kg),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.ut32 = 0,
    .max.ut32 = 0xffffffff,
    .min.ut32 = 0,
  },
  /* 脉冲累计 */
  {
    .idx = sto_mtidx(pulse_acc_0d1g),
    .page = 4,
    .focus = 1,
    .addr = sto_addr(pulse_acc_0d1g),
    .fixstr = &sto_fixstr_pointer(pulse_acc_0d1g),
    .dynstr = sto_dynstr_fpointer(pulse_acc_0d1g),
    .ckcb = NULL,
    .upcb = sto_upcb_fpointer(pulse_acc_0d1g),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.st64 = 0,
    .max.st64  = 0,
    .min.st64  = 0,
  },
  /* 定量脉冲开关及宽度 ms */
  {
    .idx = sto_mtidx(weight_pulse_wide),
    .page = 4,
    .focus = 2,
    .addr = sto_addr(weight_pulse_wide),
    .fixstr = &sto_fixstr_pointer(weight_pulse_wide),
    .dynstr = sto_dynstr_fpointer(weight_pulse_wide),
    .ckcb = sto_ckcb_general_ut16,
    .upcb = sto_upcb_fpointer(weight_pulse_wide),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.ut16 = 0,
    .max.ut16 = 0xffff,
    .min.ut16 = 0,
  },
  /* ao1零点内码(pwm值) ????? */
  {
    .idx = sto_mtidx(ao1_zero_code),
    .page = 4,
    .focus = 3,
    .addr = sto_addr(ao1_zero_code),
    .fixstr = &sto_fixstr_pointer(ao1_zero_code),
    .dynstr = sto_dynstr_fpointer(ao1_zero_code),
    .ckcb = sto_ckcb_general_ut16,
    .upcb = sto_upcb_fpointer(ao1_zero_code),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.ut16 = 10625,
    .max.ut16 = 0xffff,
    .min.ut16 = 1,
  },
  /* ao1满度内码(pwm值) ????? */
  {
    .idx = sto_mtidx(ao1_full_code),
    .page = 4,
    .focus = 4,
    .addr = sto_addr(ao1_full_code),
    .fixstr = &sto_fixstr_pointer(ao1_full_code),
    .dynstr = sto_dynstr_fpointer(ao1_full_code),
    .ckcb = sto_ckcb_general_ut16,
    .upcb = sto_upcb_fpointer(ao1_full_code),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.ut16 = 62875,
    .max.ut16 = 0xffff,
    .min.ut16 = 2,
  },
  /* ao2零点内码(pwm值) ????? */
  {
    .idx = sto_mtidx(ao2_zero_code),
    .page = 4,
    .focus = 5,
    .addr = sto_addr(ao2_zero_code),
    .fixstr = &sto_fixstr_pointer(ao2_zero_code),
    .dynstr = sto_dynstr_fpointer(ao2_zero_code),
    .ckcb = sto_ckcb_general_ut16,
    .upcb = sto_upcb_fpointer(ao2_zero_code),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.ut16 = 10625,
    .max.ut16 = 0xffff,
    .min.ut16 = 1,
  },
  /* ao2满度内码(pwm值) ????? */
  {
    .idx = sto_mtidx(ao2_full_code),
    .page = 4,
    .focus = 6,
    .addr = sto_addr(ao2_full_code),
    .fixstr = &sto_fixstr_pointer(ao2_full_code),
    .dynstr = sto_dynstr_fpointer(ao2_full_code),
    .ckcb = sto_ckcb_general_ut16,
    .upcb = sto_upcb_fpointer(ao2_full_code),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.ut16 = 62875,
    .max.ut16 = 0xffff,
    .min.ut16 = 1,
  },
  /* 传感器 速度  地址 */
  {
    .idx = sto_mtidx(spd_sensor_addr),
    .page = 5,
    .focus = 0,
    .addr = sto_addr(spd_sensor_addr),
    .fixstr = &sto_fixstr_pointer(spd_sensor_addr),
    .dynstr = sto_dynstr_fpointer(spd_sensor_addr),
    .ckcb = sto_ckcb_general_ut16_with0,
    .upcb = sto_upcb_fpointer(spd_sensor_addr),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.ut16 = 1,
    .max.ut16 = 247,
    .min.ut16 = 0,
  },
  /* 传感器 称重1 地址 */
  {
    .idx = sto_mtidx(wt1_sensor_addr),
    .page = 5,
    .focus = 1,
    .addr = sto_addr(wt1_sensor_addr),
    .fixstr = &sto_fixstr_pointer(wt1_sensor_addr),
    .dynstr = sto_dynstr_fpointer(wt1_sensor_addr),
    .ckcb = sto_ckcb_general_ut16_with0,
    .upcb = sto_upcb_fpointer(wt1_sensor_addr),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.ut16 = 2,
    .max.ut16 = 247,
    .min.ut16 = 0,
  },
  /* 传感器 称重2 地址 */
  {
    .idx = sto_mtidx(wt2_sensor_addr),
    .page = 5,
    .focus = 2,
    .addr = sto_addr(wt2_sensor_addr),
    .fixstr = &sto_fixstr_pointer(wt2_sensor_addr),
    .dynstr = sto_dynstr_fpointer(wt2_sensor_addr),
    .ckcb = sto_ckcb_general_ut16_with0,
    .upcb = sto_upcb_fpointer(wt2_sensor_addr),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.ut16 = 3,
    .max.ut16 = 247,
    .min.ut16 = 0,
  },
  /* 传感器 称重3 地址 */
  {
    .idx = sto_mtidx(wt3_sensor_addr),
    .page = 5,
    .focus = 3,
    .addr = sto_addr(wt3_sensor_addr),
    .fixstr = &sto_fixstr_pointer(wt3_sensor_addr),
    .dynstr = sto_dynstr_fpointer(wt3_sensor_addr),
    .ckcb = sto_ckcb_general_ut16_with0,
    .upcb = sto_upcb_fpointer(wt3_sensor_addr),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.ut16 = 4,
    .max.ut16 = 247,
    .min.ut16 = 0,
  },
  /* 传感器 称重4 地址 */
  {
    .idx = sto_mtidx(wt4_sensor_addr),
    .page = 5,
    .focus = 4,
    .addr = sto_addr(wt4_sensor_addr),
    .fixstr = &sto_fixstr_pointer(wt4_sensor_addr),
    .dynstr = sto_dynstr_fpointer(wt4_sensor_addr),
    .ckcb = sto_ckcb_general_ut16_with0,
    .upcb = sto_upcb_fpointer(wt4_sensor_addr),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.ut16 = 5,
    .max.ut16 = 247,
    .min.ut16 = 0,
  },
  /* 产量监控网络收发参数 */
  /* 市名/编号 */
  {
    .idx = sto_mtidx(prod_city_num),
    .page = 6,
    .focus = 0,
    .addr = sto_addr(prod_city_num),
    .fixstr = &sto_fixstr_pointer(prod_city_num),
    .dynstr = sto_dynstr_fpointer(prod_city_num),
    .ckcb = NULL,
    .upcb = sto_upcb_fpointer(prod_city_num),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.ut32 = 0,
    .max.ut32 = 0,
    .min.ut32 = 0,
  },
  /* 县名/编号 */
  {
    .idx = sto_mtidx(prod_county_num),
    .page = 6,
    .focus = 1,
    .addr = sto_addr(prod_county_num),
    .fixstr = &sto_fixstr_pointer(prod_county_num),
    .dynstr = sto_dynstr_fpointer(prod_county_num),
    .ckcb = NULL,
    .upcb = sto_upcb_fpointer(prod_county_num),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.ut32 = 0,
    .max.ut32 = 0,
    .min.ut32 = 0,
  },
  /* 矿名/编号 */
  {
    .idx = sto_mtidx(prod_mines_num),
    .page = 6,
    .focus = 2,
    .addr = sto_addr(prod_mines_num),
    .fixstr = &sto_fixstr_pointer(prod_mines_num),
    .dynstr = sto_dynstr_fpointer(prod_mines_num),
    .ckcb = NULL,
    .upcb = sto_upcb_fpointer(prod_mines_num),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.ut32 = 0,
    .max.ut32 = 0,
    .min.ut32 = 0,
  },
  /* 核定年生产能力 */
  {
    .idx = sto_mtidx(prod_year_capacity_t),
    .page = 6,
    .focus = 3,
    .addr = sto_addr(prod_year_capacity_t),
    .fixstr = &sto_fixstr_pointer(prod_year_capacity_t),
    .dynstr = sto_dynstr_fpointer(prod_year_capacity_t),
    .ckcb = sto_ckcb_general_ut32,
    .upcb = sto_upcb_fpointer(prod_year_capacity_t),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.ut32 = 0,
    .max.ut32 = 4000000000,
    .min.ut32 = 0,
  },
  /* 核定月生产能力 */
  {
    .idx = sto_mtidx(prod_month_capacity_t),
    .page = 6,
    .focus = 4,
    .addr = sto_addr(prod_month_capacity_t),
    .fixstr = &sto_fixstr_pointer(prod_month_capacity_t),
    .dynstr = sto_dynstr_fpointer(prod_month_capacity_t),
    .ckcb = sto_ckcb_general_ut32,
    .upcb = sto_upcb_fpointer(prod_month_capacity_t),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.ut32 = 0,
    .max.ut32 = 4000000000,
    .min.ut32 = 0,
  },
  /* 核定日生产能力 */
  {
    .idx = sto_mtidx(prod_day_capacity_t),
    .page = 6,
    .focus = 5,
    .addr = sto_addr(prod_day_capacity_t),
    .fixstr = &sto_fixstr_pointer(prod_day_capacity_t),
    .dynstr = sto_dynstr_fpointer(prod_day_capacity_t),
    .ckcb = sto_ckcb_general_ut32,
    .upcb = sto_upcb_fpointer(prod_day_capacity_t),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.ut32 = 0,
    .max.ut32 = 4000000000,
    .min.ut32 = 0,
  },
  /* 核定时生产能力 */
  {
    .idx = sto_mtidx(prod_hour_capacity_t),
    .page = 6,
    .focus = 6,
    .addr = sto_addr(prod_hour_capacity_t),
    .fixstr = &sto_fixstr_pointer(prod_hour_capacity_t),
    .dynstr = sto_dynstr_fpointer(prod_hour_capacity_t),
    .ckcb = sto_ckcb_general_ut32,
    .upcb = sto_upcb_fpointer(prod_hour_capacity_t),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.ut32 = 0,
    .max.ut32 = 4000000000,
    .min.ut32 = 0,
  },
  /* 间隔参量时间 也是上传时间 s */
  {
    .idx = sto_mtidx(prod_interval_time_s),
    .page = 6,
    .focus = 7,
    .addr = sto_addr(prod_interval_time_s),
    .fixstr = &sto_fixstr_pointer(prod_interval_time_s),
    .dynstr = sto_dynstr_fpointer(prod_interval_time_s),
    .ckcb = sto_ckcb_general_ut32,
    .upcb = sto_upcb_fpointer(prod_interval_time_s),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.ut32 = 60,
    .max.ut32 = 99999999,
    .min.ut32 = 60,
  },
  /* 产量网络发送超时时间 s */
  {
    .idx = sto_mtidx(prod_net_timeout_s),
    .page = 6,
    .focus = 8,
    .addr = sto_addr(prod_net_timeout_s),
    .fixstr = &sto_fixstr_pointer(prod_net_timeout_s),
    .dynstr = sto_dynstr_fpointer(prod_net_timeout_s),
    .ckcb = sto_ckcb_general_ut32,
    .upcb = sto_upcb_fpointer(prod_net_timeout_s),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.ut32 = 1,
    .max.ut32 = 30,
    .min.ut32 = 1,
  },

  /* 本机IP  u8x4 */
  {
    .idx = sto_mtidx(eth_local_ip),
    .page = 7,
    .focus = 0,
    .addr = sto_addr(eth_local_ip),
    .fixstr = &sto_fixstr_pointer(eth_local_ip),
    .dynstr = sto_dynstr_fpointer(eth_local_ip),
    .ckcb = sto_ckcb_general_ip,
    .upcb = sto_upcb_fpointer(eth_local_ip),
    .input = sto_inputcb_general_ip,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.ua8 = {192,168,6,46},
    .max.ua8 = {255,255,255,255},
    .min.ua8 = {0,0,0,0},
  },
  /* 网关    u8x4 */
  {
    .idx = sto_mtidx(eth_local_gw),
    .page = 7,
    .focus = 1,
    .addr = sto_addr(eth_local_gw),
    .fixstr = &sto_fixstr_pointer(eth_local_gw),
    .dynstr = sto_dynstr_fpointer(eth_local_gw),
    .ckcb = sto_ckcb_general_ip,
    .upcb = sto_upcb_fpointer(eth_local_gw),
    .input = sto_inputcb_general_ip,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.ua8 = {192,168,6,254},
    .max.ua8 = {255,255,255,255},
    .min.ua8 = {0,0,0,0},
  },
  /* 子网掩码 u8x4 */
  {
    .idx = sto_mtidx(eth_local_msk),
    .page = 7,
    .focus = 2,
    .addr = sto_addr(eth_local_msk),
    .fixstr = &sto_fixstr_pointer(eth_local_msk),
    .dynstr = sto_dynstr_fpointer(eth_local_msk),
    .ckcb = sto_ckcb_general_ip,
    .upcb = sto_upcb_fpointer(eth_local_msk),
    .input = sto_inputcb_general_ip,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.ua8 = {255,255,255,0},
    .max.ua8 = {255,255,255,255},
    .min.ua8 = {0,0,0,0},
  },
  /* 本机MAC u8x6 */
  {
    .idx = sto_mtidx(eth_local_mac),
    .page = 7,
    .focus = 3,
    .addr = sto_addr(eth_local_mac),
    .fixstr = &sto_fixstr_pointer(eth_local_mac),
    .dynstr = sto_dynstr_fpointer(eth_local_mac),
    .ckcb = sto_ckcb_general_mac,
    .upcb = sto_upcb_fpointer(eth_local_mac),
    .input = sto_inputcb_general_ip,  /* TODO: not ip */
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.ua8 = {0x00, 0x08, 0xdc, 0x6f, 0x00, 0x8a},
    .max.ua8 = {255,255,255,255,255,255},
    .min.ua8 = {0,0,0,0,0,0},
  },
  /* 间隔参量上传 目标服务器ip u8x4 */
  {
    .idx = sto_mtidx(eth_produp_ip),
    .page = 7,
    .focus = 4,
    .addr = sto_addr(eth_produp_ip),
    .fixstr = &sto_fixstr_pointer(eth_produp_ip),
    .dynstr = sto_dynstr_fpointer(eth_produp_ip),
    .ckcb = sto_ckcb_general_ip,
    .upcb = sto_upcb_fpointer(eth_produp_ip),
    .input = sto_inputcb_general_ip,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.ua8 = {192,168,6,232},
    .max.ua8 = {255,255,255,255},
    .min.ua8 = {0,0,0,0},
  },
  /* 实时参量上传 目标服务器ip u8x4 */
  {
    .idx = sto_mtidx(eth_prodrt_ip),
    .page = 7,
    .focus = 5,
    .addr = sto_addr(eth_prodrt_ip),
    .fixstr = &sto_fixstr_pointer(eth_prodrt_ip),
    .dynstr = sto_dynstr_fpointer(eth_prodrt_ip),
    .ckcb = sto_ckcb_general_ip,
    .upcb = sto_upcb_fpointer(eth_prodrt_ip),
    .input = sto_inputcb_general_ip,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.ua8 = {192,168,6,232},
    .max.ua8 = {255,255,255,255},
    .min.ua8 = {0,0,0,0},
  },
  /* modbusTCP  目标服务器ip u8x4 */
  {
    .idx = sto_mtidx(eth_mbtcp_ip),
    .page = 7,
    .focus = 6,
    .addr = sto_addr(eth_mbtcp_ip),
    .fixstr = &sto_fixstr_pointer(eth_mbtcp_ip),
    .dynstr = sto_dynstr_fpointer(eth_mbtcp_ip),
    .ckcb = sto_ckcb_general_ip,
    .upcb = sto_upcb_fpointer(eth_mbtcp_ip),
    .input = sto_inputcb_general_ip,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.ua8 = {192,168,6,232},
    .max.ua8 = {255,255,255,255},
    .min.ua8 = {0,0,0,0},
  },
  /* 间隔参量上传 目标服务器端口 */
  {
    .idx = sto_mtidx(eth_produp_port),
    .page = 7,
    .focus = 7,
    .addr = sto_addr(eth_produp_port),
    .fixstr = &sto_fixstr_pointer(eth_produp_port),
    .dynstr = sto_dynstr_fpointer(eth_produp_port),
    .ckcb = sto_ckcb_general_ut16,
    .upcb = sto_upcb_fpointer(eth_produp_port),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.ut16 = 8002,
    .max.ut16 = 65535,
    .min.ut16 = 0,
  },
  /* 实时参量上传 目标服务器端口 */
  {
    .idx = sto_mtidx(eth_prodrt_port),
    .page = 7,
    .focus = 8,
    .addr = sto_addr(eth_prodrt_port),
    .fixstr = &sto_fixstr_pointer(eth_prodrt_port),
    .dynstr = sto_dynstr_fpointer(eth_prodrt_port),
    .ckcb = sto_ckcb_general_ut16,
    .upcb = sto_upcb_fpointer(eth_prodrt_port),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.ut16 = 8001,
    .max.ut16 = 65535,
    .min.ut16 = 0,
  },
  /* modbusTCP  目标服务器端口 */
  {
    .idx = sto_mtidx(eth_mbtcp_prot),
    .page = 7,
    .focus = 9,
    .addr = sto_addr(eth_mbtcp_prot),
    .fixstr = &sto_fixstr_pointer(eth_mbtcp_prot),
    .dynstr = sto_dynstr_fpointer(eth_mbtcp_prot),
    .ckcb = sto_ckcb_general_ut16,
    .upcb = sto_upcb_fpointer(eth_mbtcp_prot),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.ut16 = 8001,
    .max.ut16 = 65535,
    .min.ut16 = 0,
  },

  /* 校验砝码重量 0.1g ##### */
  {
    .idx = sto_mtidx(cal_fama_weight_0d1g),
    .page = 8,
    .focus = 0,
    .addr = sto_addr(cal_fama_weight_0d1g),
    .fixstr = &sto_fixstr_pointer(cal_fama_weight_0d1g),
    .dynstr = sto_dynstr_fpointer(cal_fama_weight_0d1g),
    .ckcb = sto_ckcb_general_ut32,
    .upcb = sto_upcb_fpointer(cal_fama_weight_0d1g),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.ut32 = 2000000,
    .max.ut32 = 999999999,
    .min.ut32 = 0,
  },
  /* 校验实物重量 kg */
  {
    .idx = sto_mtidx(cal_shiwu_weight_kg),
    .page = 8,
    .focus = 1,
    .addr = sto_addr(cal_shiwu_weight_kg),
    .fixstr = &sto_fixstr_pointer(cal_shiwu_weight_kg),
    .dynstr = sto_dynstr_fpointer(cal_shiwu_weight_kg),
    .ckcb = sto_ckcb_general_ut32,
    .upcb = sto_upcb_fpointer(cal_shiwu_weight_kg),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.ut32 = 1000,
    .max.ut32 = 999999999,
    .min.ut32 = 0,
  },
  /* 校验链码密度 g/m ##### */
  {
    .idx = sto_mtidx(cal_lianma_denser_0d1gpm),
    .page = 8,
    .focus = 2,
    .addr = sto_addr(cal_lianma_denser_0d1gpm),
    .fixstr = &sto_fixstr_pointer(cal_lianma_denser_0d1gpm),
    .dynstr = sto_dynstr_fpointer(cal_lianma_denser_0d1gpm),
    .ckcb = sto_ckcb_general_ut32,
    .upcb = sto_upcb_fpointer(cal_lianma_denser_0d1gpm),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.ut32 = 10000000,
    .max.ut32 = 0xffffffff,
    .min.ut32 = 0,
  },
  /* 校验实物重量是否计入产量 */
  {
    .idx = sto_mtidx(cal_shiwu_wtacc),
    .page = 8,
    .focus = 3,
    .addr = sto_addr(cal_shiwu_wtacc),
    .fixstr = &sto_fixstr_pointer(cal_shiwu_wtacc),
    .dynstr = sto_dynstr_fpointer(cal_shiwu_wtacc),
    .ckcb = sto_ckcb_general_bool,
    .upcb = sto_upcb_fpointer(cal_shiwu_wtacc),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.ut16 = 0,
    .max.ut16 = 1,
    .min.ut16 = 0,
  },
  /* 整圈方式 0定时 1定长 */
  {
    .idx = sto_mtidx(len_circle_mode),
    .page = 8,
    .focus = 4,
    .addr = sto_addr(len_circle_mode),
    .fixstr = &sto_fixstr_pointer(len_circle_mode),
    .dynstr = sto_dynstr_fpointer(len_circle_mode),
    .ckcb = sto_ckcb_general_bool,
    .upcb = sto_upcb_fpointer(len_circle_mode),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.ut16 = 0,
    .max.ut16 = 1,
    .min.ut16 = 0,
  },
  /* 皮带周期 0.01s ##### */
  {
    .idx = sto_mtidx(belt_period_0d01s),
    .page = 8,
    .focus = 5,
    .addr = sto_addr(belt_period_0d01s),
    .fixstr = &sto_fixstr_pointer(belt_period_0d01s),
    .dynstr = sto_dynstr_fpointer(belt_period_0d01s),
    .ckcb = sto_ckcb_general_ut32,
    .upcb = sto_upcb_fpointer(belt_period_0d01s),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.ut32 = 60000,
    .max.ut32 = 999999999,
    .min.ut32 = 100,
  },
  /* 皮带周长 mm ##### */
  {
    .idx = sto_mtidx(belt_length_mm),
    .page = 8,
    .focus = 6,
    .addr = sto_addr(belt_length_mm),
    .fixstr = &sto_fixstr_pointer(belt_length_mm),
    .dynstr = sto_dynstr_fpointer(belt_length_mm),
    .ckcb = sto_ckcb_general_ut32,
    .upcb = sto_upcb_fpointer(belt_length_mm),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.ut32 = 100000,
    .max.ut32 = 999999999,
    .min.ut32 = 1000,
  },
  /* 称量长度 mm #####  源文档中为u16 单位是mm 可能不够? 改u32 */
  {
    .idx = sto_mtidx(effect_length_mm),
    .page = 8,
    .focus = 7,
    .addr = sto_addr(effect_length_mm),
    .fixstr = &sto_fixstr_pointer(effect_length_mm),
    .dynstr = sto_dynstr_fpointer(effect_length_mm),
    .ckcb = sto_ckcb_general_ut32,
    .upcb = sto_upcb_fpointer(effect_length_mm),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.ut32 = 1200,
    .max.ut32 = 0xffff,
    .min.ut32 = 100,
  },
  /* 测速轮周长 0.1mm ##### */
  {
    .idx = sto_mtidx(speed_wheel_cir_0d1mm),
    .page = 8,
    .focus = 8,
    .addr = sto_addr(speed_wheel_cir_0d1mm),
    .fixstr = &sto_fixstr_pointer(speed_wheel_cir_0d1mm),
    .dynstr = sto_dynstr_fpointer(speed_wheel_cir_0d1mm),
    .ckcb = sto_ckcb_general_ut16,
    .upcb = sto_upcb_fpointer(speed_wheel_cir_0d1mm),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.ut16 = 3140,
    .max.ut16 = 0xffff,
    .min.ut16 = 30,
  },
  /* 测速轮每周脉冲 */
  {
    .idx = sto_mtidx(speed_wheel_pls),
    .page = 8,
    .focus = 9,
    .addr = sto_addr(speed_wheel_pls),
    .fixstr = &sto_fixstr_pointer(speed_wheel_pls),
    .dynstr = sto_dynstr_fpointer(speed_wheel_pls),
    .ckcb = sto_ckcb_general_ut16,
    .upcb = sto_upcb_fpointer(speed_wheel_pls),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.ut16 = 80,
    .max.ut16 = 0xffff,
    .min.ut16 = 1,
  },
  
  /* 零点内码 */
  {
    .idx = sto_mtidx(zero_code_ave),
    .page = 8,
    .focus = 10,
    .addr = sto_addr(zero_code_ave),
    .fixstr = &sto_fixstr_pointer(zero_code_ave),
    .dynstr = sto_dynstr_fpointer(zero_code_ave),

    .ckcb = sto_ckcb_general_st32,
    .upcb = sto_upcb_fpointer(zero_code_ave),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.st32 = 0,
    .max.st32 = 65535,
    .min.st32 = -65535,
  },
  /* 零点内码上限 */
  {
    .idx = sto_mtidx(zero_code_uplimit),
    .page = 8,
    .focus = 11,
    .addr = sto_addr(zero_code_uplimit),
    .fixstr = &sto_fixstr_pointer(zero_code_uplimit),
    .dynstr = sto_dynstr_fpointer(zero_code_uplimit),
    .ckcb = sto_ckcb_general_st32,
    .upcb = sto_upcb_fpointer(zero_code_uplimit),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.st32 = 20000,
    .max.st32 = 65535,
    .min.st32 = -65535,
  },
  /* 手动调零强度 */
  {
    .idx = sto_mtidx(manu_zero_range),
    .page = 8,
    .focus = 12,
    .addr = sto_addr(manu_zero_range),
    .fixstr = &sto_fixstr_pointer(manu_zero_range),
    .dynstr = sto_dynstr_fpointer(manu_zero_range),
    .ckcb = sto_ckcb_general_ut16,
    .upcb = sto_upcb_fpointer(manu_zero_range),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.ut16 = 50,
    .max.ut16 = 0xffff,
    .min.ut16 = 0,
  },
  /* 称量系数基础值 */
  {
    .idx = sto_mtidx(weight_factor_base),
    .page = 8,
    .focus = 13,
    .addr = sto_addr(weight_factor_base),
    .fixstr = &sto_fixstr_pointer(weight_factor_base),
    .dynstr = sto_dynstr_fpointer(weight_factor_base),
    .ckcb = sto_ckcb_general_ut32,
    .upcb = sto_upcb_fpointer(weight_factor_base),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.ut32 = 250000,
    .max.ut32 = 999999999,
    .min.ut32 = 0,
  },
  /* 系数修正使能 */
  {
    .idx = sto_mtidx(factor_correct_enable),
    .page = 8,
    .focus = 14,
    .addr = sto_addr(factor_correct_enable),
    .fixstr = &sto_fixstr_pointer(factor_correct_enable),
    .dynstr = sto_dynstr_fpointer(factor_correct_enable),
    .ckcb = sto_ckcb_general_bool,
    .upcb = sto_upcb_fpointer(factor_correct_enable),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.ut16 = 0,
    .max.ut16 = 1,
    .min.ut16 = 0,
  },
  /* 称量系数01 (  >1600   t/h) */
  {
    .idx = sto_mtidx(weight_factor01),
    .page = 8,
    .focus = 15,
    .addr = sto_addr(weight_factor01),
    .fixstr = &sto_fixstr_pointer(weight_factor01),
    .dynstr = sto_dynstr_fpointer(weight_factor01),
    .ckcb = sto_ckcb_general_st32,
    .upcb = sto_upcb_fpointer(weight_factor01),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.st32 = 0,
    .max.st32 = 999999999,
    .min.st32 = -999999999,
  },
  /* 称量系数02 (1200~1600 t/h) */
  {
    .idx = sto_mtidx(weight_factor02),
    .page = 8,
    .focus = 16,
    .addr = sto_addr(weight_factor02),
    .fixstr = &sto_fixstr_pointer(weight_factor02),
    .dynstr = sto_dynstr_fpointer(weight_factor02),
    .ckcb = sto_ckcb_general_st32,
    .upcb = sto_upcb_fpointer(weight_factor02),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.st32 = 0,
    .max.st32 = 999999999,
    .min.st32 = -999999999,
  },
  /* 称量系数03 (800~1200  t/h) */
  {
    .idx = sto_mtidx(weight_factor03),
    .page = 8,
    .focus = 17,
    .addr = sto_addr(weight_factor03),
    .fixstr = &sto_fixstr_pointer(weight_factor03),
    .dynstr = sto_dynstr_fpointer(weight_factor03),
    .ckcb = sto_ckcb_general_st32,
    .upcb = sto_upcb_fpointer(weight_factor03),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.st32 = 0,
    .max.st32 = 999999999,
    .min.st32 = -999999999,
  },
  /* 称量系数04 (400~800   t/h) */
  {
    .idx = sto_mtidx(weight_factor04),
    .page = 8,
    .focus = 18,
    .addr = sto_addr(weight_factor04),
    .fixstr = &sto_fixstr_pointer(weight_factor04),
    .dynstr = sto_dynstr_fpointer(weight_factor04),
    .ckcb = sto_ckcb_general_st32,
    .upcb = sto_upcb_fpointer(weight_factor04),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.st32 = 0,
    .max.st32 = 999999999,
    .min.st32 = -999999999,
  },
  /* 称量系数05 (  <400    t/h) */
  {
    .idx = sto_mtidx(weight_factor05),
    .page = 8,
    .focus = 19,
    .addr = sto_addr(weight_factor05),
    .fixstr = &sto_fixstr_pointer(weight_factor05),
    .dynstr = sto_dynstr_fpointer(weight_factor05),
    .ckcb = sto_ckcb_general_st32,
    .upcb = sto_upcb_fpointer(weight_factor05),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.st32 = 0,
    .max.st32 = 999999999,
    .min.st32 = -999999999,
  },

  
/* 以下参数只参与存储、modbus只读,外部不可设置 */
  /* 上次总累计清零日期 */
  {
    .idx = sto_mtidx(total_last_switch),
    .page = 0,
    .focus = 0,
    .addr = sto_addr(total_last_switch),
    .fixstr = &sto_fixstr_pointer(total_last_switch),
    .dynstr = sto_dynstr_fpointer(total_last_switch),
    .ckcb = sto_ckcb_datatime,  /* todo: 年月日分不是谁都有 */
    .upcb = sto_upcb_fpointer(total_last_switch),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.dt = {.year=24, .month=1, .day=1, .hour=0, .minute=0, .second=0, .a0m1=0},
    .max.dt  = {.year=24, .month=1, .day=1, .hour=0, .minute=0, .second=0, .a0m1=0},
    .min.dt  = {.year=24, .month=1, .day=1, .hour=0, .minute=0, .second=0, .a0m1=0},
  },
  /* 上次年累计清零日期 */
  {
    .idx = sto_mtidx(year_last_switch),
    .page = 0,
    .focus = 0,
    .addr = sto_addr(year_last_switch),
    .fixstr = &sto_fixstr_pointer(year_last_switch),
    .dynstr = sto_dynstr_fpointer(year_last_switch),
    .ckcb = sto_ckcb_datatime,  /* todo: 年月日分不是谁都有 */
    .upcb = sto_upcb_fpointer(year_last_switch),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.dt = {.year=24, .month=1, .day=1, .hour=0, .minute=0, .second=0, .a0m1=0},
    .max.dt  = {.year=24, .month=1, .day=1, .hour=0, .minute=0, .second=0, .a0m1=0},
    .min.dt  = {.year=24, .month=1, .day=1, .hour=0, .minute=0, .second=0, .a0m1=0},
  },
  /* 上次月累计清零日期 */
  {
    .idx = sto_mtidx(month_last_switch),
    .page = 0,
    .focus = 0,
    .addr = sto_addr(month_last_switch),
    .fixstr = &sto_fixstr_pointer(month_last_switch),
    .dynstr = sto_dynstr_fpointer(month_last_switch),
    .ckcb = sto_ckcb_datatime,  /* todo: 年月日分不是谁都有 */
    .upcb = sto_upcb_fpointer(month_last_switch),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.dt = {.year=24, .month=1, .day=1, .hour=0, .minute=0, .second=0, .a0m1=0},
    .max.dt  = {.year=24, .month=1, .day=1, .hour=0, .minute=0, .second=0, .a0m1=0},
    .min.dt  = {.year=24, .month=1, .day=1, .hour=0, .minute=0, .second=0, .a0m1=0},
  },
  /* 上次日累计清零日期 */
  {
    .idx = sto_mtidx(day_last_switch),
    .page = 0,
    .focus = 0,
    .addr = sto_addr(day_last_switch),
    .fixstr = &sto_fixstr_pointer(day_last_switch),
    .dynstr = sto_dynstr_fpointer(day_last_switch),
    .ckcb = sto_ckcb_datatime,  /* todo: 年月日分不是谁都有 */
    .upcb = sto_upcb_fpointer(day_last_switch),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.dt = {.year=24, .month=1, .day=1, .hour=0, .minute=0, .second=0, .a0m1=0},
    .max.dt  = {.year=24, .month=1, .day=1, .hour=0, .minute=0, .second=0, .a0m1=0},
    .min.dt  = {.year=24, .month=1, .day=1, .hour=0, .minute=0, .second=0, .a0m1=0},
  },
  /* 上次时累计清零日期 */
  {
    .idx = sto_mtidx(hour_last_switch),
    .page = 0,
    .focus = 0,
    .addr = sto_addr(hour_last_switch),
    .fixstr = &sto_fixstr_pointer(hour_last_switch),
    .dynstr = sto_dynstr_fpointer(hour_last_switch),
    .ckcb = sto_ckcb_datatime,  /* todo: 年月日分不是谁都有 */
    .upcb = sto_upcb_fpointer(hour_last_switch),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.dt = {.year=24, .month=1, .day=1, .hour=0, .minute=0, .second=0, .a0m1=0},
    .max.dt  = {.year=24, .month=1, .day=1, .hour=0, .minute=0, .second=0, .a0m1=0},
    .min.dt  = {.year=24, .month=1, .day=1, .hour=0, .minute=0, .second=0, .a0m1=0},
  },
  /* 上次班累计清零日期 */
  {
    .idx = sto_mtidx(class_last_switch),
    .page = 0,
    .focus = 0,
    .addr = sto_addr(class_last_switch),
    .fixstr = &sto_fixstr_pointer(class_last_switch),
    .dynstr = sto_dynstr_fpointer(class_last_switch),
    .ckcb = sto_ckcb_datatime,  /* todo: 年月日分不是谁都有 */
    .upcb = sto_upcb_fpointer(class_last_switch),
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.dt = {.year=24, .month=1, .day=1, .hour=0, .minute=0, .second=0, .a0m1=0},
    .max.dt  = {.year=24, .month=1, .day=1, .hour=0, .minute=0, .second=0, .a0m1=0},
    .min.dt  = {.year=24, .month=1, .day=1, .hour=0, .minute=0, .second=0, .a0m1=0},
  },
  /* end */
  {
    .idx = sto_mtidx(end),
    .page = 0,
    .focus = 0,
    .addr = sto_addr(end),
    .fixstr = NULL,
    .dynstr = NULL,
    .ckcb = NULL,
    .upcb = NULL,
    .input = sto_inputcb_general_number,
    .inputbuf = inputbuffer,
    .inputpos = &intput_pos,
    .init.ut64 = 0xaaaa,
    .max.ut64 = 0xaaaa,
    .min.ut64 = 0xaaaa,
  },
};

const Sto_MaintainTableStru sto_maintain_table =
{
  /* 实际维护表大小(其中包括只显示的、者只存储的或者两者,所以表大小!=存储索引) */
  .tablesize  = sizeof(sto_maintain) / sizeof(Sto_MaintainStru), 
  .saveidxend = sto_mtidx(end),
  .maint  = sto_maintain,
};
